/**
 * Created with CLion.
 * Description: 
 * User: loong
 * Date: 2024/6/14
 * Time: 22:53
 */

#ifndef TRUMPSELECT_H
#define TRUMPSELECT_H
#include "Global.h"
using namespace std;
namespace Upgrade {

    class TrumpSelect : public QWidget
    {
        Q_OBJECT

    public:
        explicit TrumpSelect(QWidget *_parent = nullptr);

    public slots:
        void AddSuit(CardSuit _suit);

        void AddJoker(CardRank _joker);

        // bool HaveJoker();

        void SetEnable(CardSuit _suit, bool _enable);
    signals:
        void IsAlready();

        void Select(CardSuit _suit);
    private:
        void InitUi();
        void InitState();
        void InitWidget();
        void Check();

    protected:
        void paintEvent(QPaintEvent *event) override;
        void mousePressEvent(QMouseEvent *event) override;
        void mouseReleaseEvent(QMouseEvent *event) override;
        void mouseMoveEvent(QMouseEvent *event) override;

    private:
        QMap<CardSuit, QPushButton *> suits_label_;

        int            small_joker_count_ = 0b000;
        int            big_joker_count_   = 0b000;
        CardSuits      suits_;
    };

}// namespace Upgrade

#endif//TRUMPSELECT_H
